<template>
	<view class="lesson">
		<view class="tags">
			<view class="title">视频学科</view>
			<!--标签选择-->
			<selectLabel 
				:examList="examList"
				:topicList="topicList"
				@labelType = "getLabelType"></selectLabel>
		</view>
		<view class="video-list">
			<view class="video-item">
				<image class="img" src="https://img2.baidu.com/it/u=2606943158,1225302912&fm=26&fmt=auto" mode="widthFix"></image>
				<view class="info">
					<text class="info-title">语文试卷1</text>
					<text>学科：语文</text>
					<text>试卷：20200906卷</text>
				</view>
				<view class="btn">开始答题</view>
			</view>
			<view class="video-item">
				<image class="img" src="https://img2.baidu.com/it/u=2606943158,1225302912&fm=26&fmt=auto" mode="widthFix"></image>
				<view class="info">
					<text class="info-title">语文试卷1</text>
					<text>学科：语文</text>
					<text>试卷：20200906卷</text>
				</view>
				<view class="btn">开始答题</view>
			</view>
			<view class="video-item">
				<image class="img" src="https://img2.baidu.com/it/u=2606943158,1225302912&fm=26&fmt=auto" mode="widthFix"></image>
				<view class="info">
					<text class="info-title">语文试卷1</text>
					<text>学科：语文</text>
					<text>试卷：20200906卷</text>
				</view>
				<view class="btn">开始答题</view>
			</view>
			<view class="video-item">
				<image class="img" src="https://img2.baidu.com/it/u=2606943158,1225302912&fm=26&fmt=auto" mode="widthFix"></image>
				<view class="info">
					<text class="info-title">语文试卷1</text>
					<text>学科：语文</text>
					<text>试卷：20200906卷</text>
				</view>
				<view class="btn">开始答题</view>
			</view>
			<view class="video-item">
				<image class="img" src="https://img2.baidu.com/it/u=2606943158,1225302912&fm=26&fmt=auto" mode="widthFix"></image>
				<view class="info">
					<text class="info-title">语文试卷1</text>
					<text>学科：语文</text>
					<text>试卷：20200906卷</text>
				</view>
				<view class="btn">开始答题</view>
			</view>
			<view class="video-item">
				<image class="img" src="https://img2.baidu.com/it/u=2606943158,1225302912&fm=26&fmt=auto" mode="widthFix"></image>
				<view class="info">
					<text class="info-title">语文试卷1</text>
					<text>学科：语文</text>
					<text>试卷：20200906卷</text>
				</view>
				<view class="btn">开始答题</view>
			</view>
			<view class="video-item">
				<image class="img" src="https://img2.baidu.com/it/u=2606943158,1225302912&fm=26&fmt=auto" mode="widthFix"></image>
				<view class="info">
					<text class="info-title">语文试卷1</text>
					<text>学科：语文</text>
					<text>试卷：20200906卷</text>
				</view>
				<view class="btn">开始答题</view>
			</view>
		</view>
		<view class="bottom"> ---我是有底线的---</view>
	</view>
</template>

<script>
	import selectLabel from '@/components/selectTabel/selectTabel.vue'
	export default {
		data() {
			return {
				examList:[],
				//学科类型标签
				topicList:[{
					id : 1,
					name : "全部"
				},{
					id : 2,
					name : "语文"
				},{
					id : 3,
					name : "数学"
				},{
					id : 4,
					name : "英语"
				},{
					id : 5,
					name : "绘画"
				},{
					id : 6,
					name : "科学"
				}]
			}
		},
		onLoad(){
			//获取token
			let token = uni.getStorageSync("token");
			console.log(!token);
			if( !token){
				// uni.showToast({
				// 	title: "请先登录！！"
				// })
				uni.redirectTo ({
					url: "/pages/login/login"
				});
			}
		},
		components:{
			selectLabel
		},
		methods: {
			getLabelType(data){
				console.log(data);
			}
		}
	}
</script>

<style lang="scss">
.lesson{
	display: flex;
	justify-content: center;
	flex-direction: column;
	align-items: center;
	width:100%;
	box-sizing: border-box;
	margin-bottom: 20rpx;
	.tags{
		width: 92%;
		margin: 20rpx 0;
		.title{
			color:#212121;
			font-size: 32rpx;
			font-weight: bold;
		}
	}
	.video-list{
		width: 92%;
		margin-bottom: 20rpx;
		.video-item{
			background: #fff;
			display: flex;
			width: 100%;
			margin-top: 30rpx;
			padding:20rpx 20rpx;
			position: relative;
			border-radius: 20rpx;
			box-sizing: border-box;
			image{
				width: 50%;
				height: 164rpx;
				border-radius: 20rpx;
			}
			
			.info{
				margin-left: 30rpx;
				display: flex;
				flex-direction: column;
				
				text{
					margin-top: 6rpx;
					font-size: 24rpx;
					color:#BFBFBF;
				}
				.info-title{
					margin-top: 18rpx;
					font-size: 28rpx;
					color:#212121;
				}
			}
			.btn{
				font-size: 28rpx;
				color:#66BB6A;
				position: absolute;
				right: 10rpx;
				bottom: 6rpx;
			}
		}
	}
	.bottom{
		font-size: 28rpx;
		color:#BFBFBF;
	}
}
</style>
